package design.mode.dispatcher.xml;


import java.util.Map;

public class XmlParseTest {
    public static void main(String[] args) {
        String xmlStr5 = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n" +
                "<root>\n" +
                "\t<head>\n" +
                "\t\t<srcCode>A123456</srcCode>\n" +
                "\t\t<srcName>jack</srcName>\n" +
                "\t\t<srcAge>15</srcAge>\n" +
                "\t</head>\n" +
                "\t<body>\n" +
                "\t\t<studentName>张三</studentName>\n" +
                "\t\t<studentAge>25</studentAge>\n" +
                "\t\t<classList>\n" +
                "\t\t\t<firstClass>\n" +
                "\t\t\t\t<className>三年级一班</className>\n" +
                "\t\t\t\t<studentCol>50</studentCol>\n" +
                "\t\t\t\t<manNum>26</manNum>\n" +
                "\t\t\t\t<fmailNum>24</fmailNum>\n" +
                "\t\t\t\t<nameList>\n" +
                "\t\t\t\t\t<childName>\n" +
                "\t\t\t\t\t\t<name1>小寒</name1>\n" +
                "\t\t\t\t\t\t<childList>\n" +
                "\t\t\t\t\t\t\t<child>\n" +
                "\t\t\t\t\t\t\t\t<sub>第三层测试</sub>\n" +
                "\t\t\t\t\t\t\t</child>\n" +
                "\t\t\t\t\t\t</childList>\n" +
                "\t\t\t\t\t</childName>\n" +
                "\t\t\t\t</nameList>\n" +
                "\t\t\t</firstClass>\n" +
                "\t\t\t<firstClass>\n" +
                "\t\t\t\t<childList>\n" +
                "\t\t\t\t\t<child>\n" +
                "\t\t\t\t\t\t<sub>第三层测试</sub>\n" +
                "\t\t\t\t\t</child>\n" +
                "\t\t\t\t</childList>\n" +
                "\t\t\t\t<className>三年级二班</className>\n" +
                "\t\t\t\t<studentCol>40</studentCol>\n" +
                "\t\t\t\t<manNum>23</manNum>\n" +
                "\t\t\t\t<fmailNum>17</fmailNum>\n" +
                "\t\t\t</firstClass>\n" +
                "\t\t</classList>\n" +
                "\t</body>\n" +
                "</root>";
        try {
            Map<String, Object> map = XmlUtil.xmlToMap(xmlStr5);
            System.out.println(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
